﻿<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" AlignItems="AlignItems.Center" Gap="0.5rem" class="rz-p-12">
    <RadzenLabel Text="Select Date" Component="DatePickerSpecialDates" />
    <RadzenDatePicker @bind-Value=@value DateRender=@DateRender Name="DatePickerSpecialDates" />
</RadzenStack>

@code {
    DateTime? value = DateTime.Now;
    IEnumerable<DateTime> dates = new DateTime[] { DateTime.Today.AddDays(-1), DateTime.Today.AddDays(1) };

    void DateRender(DateRenderEventArgs args)
    {
        var special = dates.Select(d => d.Date).Contains(args.Date.Date);
        if (special)
        {
            args.Attributes.Add("style", "background-color: #ff6d41; border-color: white;");
        }

        args.Disabled = special || args.Disabled || args.Date.DayOfWeek == DayOfWeek.Sunday || args.Date.DayOfWeek == DayOfWeek.Saturday;
    }
}